home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / YAMscripts.lha / YAMmail.rexx < prev    next >
OS/2 REXX Batch file  |  1997-06-27  |  937b  |  29 lines

  1. /* YAMmail.rexx 1.2 by knikulai@utu.fi
  2. ** Check http://www.utu.fi/~knikulai/ARexx.html for more YAM scripts
  3. ** 
  4. ** IBrowse: Network Preferences/Email & Telnet/Mailto:
  5. **          Type: External
  6. **          Command: rx YAM:Rexx/YAMmail.rexx "%h" %s
  7. */
  8.  
  9. Options Results
  10. parse arg '"'email'"' subject
  11. if pos('No_subject',subject)>0 then subject='Mail from your web page'
  12.  
  13. if ~show('P','YAM') then do           /* YAM is not running yet, so let's start it */
  14.   address command 'run <>nil: yam:yam nocheck'
  15.   i=0
  16.   do until show('P','YAM') | i=3     /* Let's not wait more than 30 seconds */
  17.     address command 'sys:rexxc/WaitForPort YAM'
  18.     i=i+1
  19.   end /* do */
  20.   if show('P','YAM')=0 then exit
  21. end
  22.  
  23. address 'YAM'              /* The following commands are sent to YAM */
  24. 'Show'                /* Uniconify */
  25. 'MailWrite'                /* Press 'Write'-button */
  26. 'WriteMailTo "'||email||'"'     /* Set address */
  27. 'WriteSubject "'||subject||'"'     /* Set subject */
  28. exit
  29.